﻿using System;
using System.Collections.Generic;
using System.Text;
using com.lover.astd.common.logic;
using com.lover.astd.common.model.enumer;

namespace com.lover.astd.common.logicexe.activities
{
    public class JailEventExe : ExeBase
    {
        public JailEventExe() { _name = ConfigStrings.S_JailEvent; _readable = ConfigStrings.SR_JailEvent; }
        public override long execute()
        {
            ActivityMgr mgr = ServiceFactory.getActivityManager();

            int result = mgr.handleJailEventInfo(_proto, _logger, _user);
            if (result == 1) return next_hour();
            if (result == 10)
            {
                _user.removeActivity(ActivityType.JailEvent);
                return next_day(); // no event today, see next day
            }
            _user.addActivity(ActivityType.JailEvent);
            return next_hour();
        }
    }
}
